import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import springIoc.life.BeanLife;
import springIoc.test03.springbean.BeanClass;

/**
 * 测试Bean的生命周期
 */
public class testLife {
    @Test
    public void test () throws Exception{
        ApplicationContext applicationContext =new ClassPathXmlApplicationContext("spring.xml");
        System.out.println("获取对象前");
        BeanLife singletontest1 = (BeanLife) applicationContext.getBean("testlife");
        System.out.println(singletontest1);
        System.out.println("获取对象后"+singletontest1);
    }
}
